package com.fs.mapper;


import com.fs.dto.EmployeePageQueryDTO;
import com.fs.entity.Employee;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface EmployeeMapper {

    /*注册员工*/
    @Insert("insert into employee(username, password, name, sex, status, create_time, update_time)" +
            " VALUES (#{username},#{password},#{name},#{sex},#{status},#{createTime},#{updateTime})")
    Integer register(Employee employee);

    /*根据用户名查询员工*/
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /*根据id显示用户信息*/
    @Select("select * from employee where id = #{id}")
    Employee getById(Long id);

    /*更新编辑员工资料*/
    Integer update(Employee employee);


    /*删除员工*/
    Integer deleteByIds(List<Long> ids);

    /*分页查询员工*/
    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
}
